package collection;

import java.util.ArrayList;
import java.util.List;

public class SubListDemo {
    public static void main(String[] args) {
        List<Integer> list=new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(i*10);
        }
        System.out.println("original list:"+list);
        List<Integer> sublist=list.subList(1,2);
        System.out.println("sublist："+sublist);
        list.set(1,123123);
        System.out.println(sublist);
        list.remove(1);
        System.out.println(list);


//        for (int i = 0; i < sublist.size(); i++) {
//            sublist.set(i,sublist.get(i)*10);
//        }
//        System.out.println("changed sublist:"+sublist);
//        System.out.println("changed list:"+list);
    }
}
